Skip to content

Ensure Example Packages Work on Android API 36 #9241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
May 22, 2025

Conversation

jesswrd
Copy link
Contributor

@jesswrd jesswrd commented May 12, 2025

Ensured the example plugin apps on Android work on Android API 36 by updating configurations and sucessfully running flutter build apk (means the app can successfully build + all dependencies are resolvable). For compatibility with Android API 36, the example plugin apps on Android should have the following configurations:

targetSdk: 36
compileSdk: 36
AGP version: 8.9.1
Gradle version: 8.11.1

Most packages no longer require a manual bump of targetSdk and compileSdk due to usage of values from Flutter Gradle Plugin. Below is a list of example plugin apps on Android:

  • third_party/flutter_svg/example/android
  • flutter_plugin_android_lifecycle/example/android
  • path_provider/path_provider/example/android
  • path_provider/path_provider_android/example/android
  • two_dimensional_scrollables/example/android
  • webview_flutter/webview_flutter/example/android
  • webview_flutter/webview_flutter_android/example/android
  • file_selector/file_selector/example/android
  • file_selector/file_selector_android/example/android
  • google_sign_in/google_sign_in/example/android
  • google_sign_in/google_sign_in_android/example/android
  • pigeon/platform_tests/test_plugin/example/android
  • pigeon/platform_tests/alternate_language_test_plugin/example/android
  • interactive_media_ads/example/android
  • camera/camera/example/android
  • camera/camera_android/example/android
  • camera/camera_android_camerax/example/android
  • local_auth/local_auth_android/example/android
  • local_auth/local_auth/example/android
  • video_player/video_player_android/example/android
  • video_player/video_player/example/android
  • url_launcher/url_launcher_android/example/android
  • url_launcher/url_launcher/example/android
  • google_maps_flutter/google_maps_flutter/example/android
  • google_maps_flutter/google_maps_flutter_android/example/android
  • in_app_purchase/in_app_purchase_android/example/android
  • in_app_purchase/in_app_purchase/example/android
  • image_picker/image_picker/example/android
  • image_picker/image_picker_android/example/android
  • go_router/example/android
  • extension_google_sign_in_as_googleapis_auth/example/android
  • quick_actions/quick_actions_android/example/android
  • quick_actions/quick_actions/example/android
  • shared_preferences/shared_preferences/example/android
  • shared_preferences/shared_preferences_android/example/android
  • animations/example/android
  • espresso/example/android
  • rfw/example/hello/android
  • rfw/example/local/android
  • rfw/example/remote/android

Partially Adresses flutter/flutter#163071

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

@jesswrd jesswrd changed the title [WIP] Ensure Packages Works on SDK 36 [WIP] Ensure Example Packages Works on SDK 36 May 12, 2025
@jesswrd jesswrd changed the title [WIP] Ensure Example Packages Works on SDK 36 [WIP] Ensure Example Packages Work on SDK 36 May 12, 2025
@jesswrd jesswrd changed the title [WIP] Ensure Example Packages Work on SDK 36 [WIP] Ensure Example Packages Work on Android API 36 May 12, 2025
Copy link
Contributor

@chunhtai chunhtai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For posterity, How did you update these projects? Did you use the android studio tool for updating the project or did you do something else?

@jesswrd
Copy link
Contributor Author

jesswrd commented May 16, 2025

For posterity, How did you update these projects? Did you use the android studio tool for updating the project or did you do something else?

I updated them manually. The values were dervied from the sdk 36 minimums from android docs here. I think to use the AGP upgrade tool, you would have to open each android project separately.

@camsim99
Copy link
Contributor

camsim99 commented May 16, 2025

@jesswrd Were you unable to get dart script/tool/bin/flutter_plugin_tools.dart update-dependency --android-dependency <dependency> --version <version> to work? Asking because I was hoping it could help simplify this for you! And I definitely wanna try fixing it if it's broken.

@jesswrd
Copy link
Contributor Author

jesswrd commented May 16, 2025

@jesswrd Were you unable to get dart script/tool/bin/flutter_plugin_tools.dart update-dependency --android-dependency <dependency> --version <version> to work? Asking because I was hoping it could help simplify this for you! And I definitely wanna try fixing it if it's broken.

Before I started manually updating, I looked into the command you suggested. I concluded I didn't need to use it for my purposes because compileSdk and targetSdk in examples do not need to be updated anymore due to usage of Flutter Grade Plugin.

I actually didn't see you could use that command to update Gradle on my first pass. I just tried it and it works well. It doesn't look like the update dependency command includes updating AGP for example apps. May be worthwhile to add. jk it's already a todo.

@jesswrd jesswrd requested a review from Hixie as a code owner May 19, 2025 11:18
@github-actions github-actions bot added the p: rfw Remote Flutter Widgets label May 19, 2025
@jesswrd
Copy link
Contributor Author

jesswrd commented May 19, 2025

Looks like the new toolchain is triggering some new lints that will need to be resolved.

done

@reidbaker
Copy link
Contributor

For posterity, How did you update these projects? Did you use the android studio tool for updating the project or did you do something else?

I updated them manually. The values were dervied from the sdk 36 minimums from android docs here. I think to use the AGP upgrade tool, you would have to open each android project separately.

Ok I think it might be valuable to pick one and use the android studio tool to see what they update. It is pretty common for there to be flags or files that also get modified that are not required but are best practices. If nothing changes except for what you have in this pr great, if not then we should look at the difference and see if it is a change that should be applied more broadly.

@reidbaker
Copy link
Contributor

For posterity, How did you update these projects? Did you use the android studio tool for updating the project or did you do something else?

I updated them manually. The values were dervied from the sdk 36 minimums from android docs here. I think to use the AGP upgrade tool, you would have to open each android project separately.

Ok I think it might be valuable to pick one and use the android studio tool to see what they update. It is pretty common for there to be flags or files that also get modified that are not required but are best practices. If nothing changes except for what you have in this pr great, if not then we should look at the difference and see if it is a change that should be applied more broadly.

NON blocking comment.

@jesswrd
Copy link
Contributor Author

jesswrd commented May 19, 2025

For posterity, How did you update these projects? Did you use the android studio tool for updating the project or did you do something else?

I updated them manually. The values were dervied from the sdk 36 minimums from android docs here. I think to use the AGP upgrade tool, you would have to open each android project separately.

Ok I think it might be valuable to pick one and use the android studio tool to see what they update. It is pretty common for there to be flags or files that also get modified that are not required but are best practices. If nothing changes except for what you have in this pr great, if not then we should look at the difference and see if it is a change that should be applied more broadly.

I did. I ended up using the command Camille suggested for Gradle. It caught some example packages I didn't catch (rfw specifically). Everything should be accounted for.

@camsim99
Copy link
Contributor

I actually didn't see you could use that command to update Gradle on my first pass. I just tried it and it works well. It doesn't look like the update dependency command includes updating AGP for example apps. May be worthwhile to add. jk it's already a todo.

Filed flutter/flutter#169151 so we remember :)

Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but what's the reason for suppressing the UseRequiresApi lint violations instead of changing to match the lint's guidance?

@jesswrd
Copy link
Contributor Author

jesswrd commented May 22, 2025

LGTM, but what's the reason for suppressing the UseRequiresApi lint violations instead of changing to match the lint's guidance?

I suppressed the lint violations because I didn't want to introduce any potential behavorial changes in this PR. @RequiresApi has strict caller requirements. It should only be used when you can demonstrate you need to use it. I can file an issue and do this in a separate PR.

@jesswrd jesswrd added the autosubmit Merge PR when tree becomes green via auto submit App label May 22, 2025
@auto-submit auto-submit bot merged commit fe5dd86 into flutter:main May 22, 2025
82 checks passed
auto-submit bot pushed a commit that referenced this pull request May 23, 2025
…9264)

> [!NOTE]  
> This should land after #9241, which should safely bumps the AGP version of this plugin's example app higher than this PR does.

Fixes flutter/flutter#168551 by implementing the `enableAudio` camera setting for video recording. Also:
- Bumps CameraX library version to the latest version,`1.5.0-beta01` (to use a new CameraX method in this implementation)
- Bumps the plugin AGP version to that which `1.5.0-beta01` requires (`8.6.0`)
- Bumps the plugin's example app AGP version to that which `1.5.0-beta01` requires (`8.6.0`) -- will be overridden by #9241
- Corrects the example app to use the `enableAudio` setting just as the app-facing camera widget does
- Adds lint errors caused by the **pigeon generated** `CameraXLibrary.g.kt` file caused by the `1.5.0-beta01` bump to a `lint-baseline.xml` file (all the errors are [`UnsageOptInUsage`](https://googlesamples.github.io/android-custom-lint-rules/checks/UnsafeOptInUsageError.md.html) lints caused by the plugin's [`ExperimentalCamera2Interop`](https://developer.android.com/reference/androidx/camera/camera2/interop/ExperimentalCamera2Interop) usage which is unrelated to this PR)

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request May 27, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request May 27, 2025
flutter/packages@af0b9a9...6eebe72

2025-05-27 [email protected] [flutter_lints] Bump lints dependency to
6.0.0 and bump package to 6.0.0 (flutter/packages#9108)
2025-05-26 [email protected] Roll Flutter from
60050a0 to 4372bfb (6 revisions) (flutter/packages#9322)
2025-05-26 [email protected] [video_player_android] Add note
about Android platform views known issue (flutter/packages#9312)
2025-05-24 [email protected] Roll Flutter from
85564cb to 60050a0 (17 revisions) (flutter/packages#9318)
2025-05-23 [email protected]
[camera_android_camerax] Implement `enableAudio` for video recording
(flutter/packages#9264)
2025-05-23 [email protected]
[video_player_android] isBuffering flag always return true after calling
seekTo method - fixed (flutter/packages#9198)
2025-05-23 [email protected] [camera,video_player] replace
onSurfaceDestroyed with onSurfaceCleanup (flutter/packages#9316)
2025-05-23 [email protected] [camera,video_player] Update Android
to 3.29 minimum (flutter/packages#9317)
2025-05-23 [email protected] Roll Flutter from
33cdd8e to 85564cb (39 revisions) (flutter/packages#9315)
2025-05-23 [email protected] Update repo for 3.32 stable
(flutter/packages#9311)
2025-05-23 [email protected] [camera_avfoundation] Correct
pigeon configuration output paths (flutter/packages#9313)
2025-05-23 [email protected] [process] Remove from the repository
(flutter/packages#9310)
2025-05-22 [email protected] Ensure Example Packages Work on
Android API 36 (flutter/packages#9241)
2025-05-22 [email protected] Roll Flutter (stable) from
c236373 to be698c4 (1274 revisions) (flutter/packages#9300)
2025-05-22 [email protected] Remove CODEOWNER for generated iOS files
(flutter/packages#9272)
2025-05-22 [email protected]
[google_maps_flutter] Removes unnecessary parentheses
(flutter/packages#9273)
2025-05-21 [email protected] Rebalance Android plugin CODEOWNERS
(flutter/packages#9298)
2025-05-21 [email protected] Roll Flutter from
9a78af5 to 33cdd8e (60 revisions) (flutter/packages#9305)
2025-05-21 [email protected] [ci] Update repository for 3.29
release (flutter/packages#9270)
2025-05-21 [email protected] Ignore .cxx/ directories
(flutter/packages#9268)
2025-05-21 [email protected] [video_player] Skip some integration
tests on web (flutter/packages#9302)
2025-05-21 [email protected]
[webview_flutter] Adds support to respond to recoverable SSL certificate
errors (flutter/packages#9150)
2025-05-19 [email protected]
[camera_android_camerax] Swap out `BroadcastReceiver` for
`OrientationEventListener` (flutter/packages#9261)
2025-05-19 [email protected]
[video_player_android] Fix incorrect dimensions swap
(flutter/packages#9199)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants